package com.ace3l.legal.gwt.domainmodule.client;

import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.core.client.GWT;
import com.synesthesiaconsulting.gwt.resources.client.GWTUtils;
import com.ace3l.legal.gwt.domainmodule.gwt.GWTStudent;
import com.ace3l.legal.gwt.domainmodule.gwt.GWTProject;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Jul 31, 2008
 * Time: 2:11:26 AM
 * To change this template use File | Settings | File Templates.
 */
public interface StudentPortalService extends RemoteService {
    /**
     * Utility/Convenience class.
     * Use StudentPortalService.App.getInstance() to access static instance of StudentPortalServiceAsync
     */
    public static class App {
        private static StudentPortalServiceAsync ourInstance = null;

        public static synchronized StudentPortalServiceAsync getInstance() {
            if (ourInstance == null) {
                ourInstance = (StudentPortalServiceAsync) GWT.create(StudentPortalService.class);
                
                if (GWT.isScript()) {
                    ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWTUtils.getUrlWithContext() + "/gwt/StudentPortalService");
                } else {
                    ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "com.ace3l.legal.gwt.domainmodule.Ace3LDomainModule/StudentPortalService");
                }
            }
            return ourInstance;
        }
    }

    public GWTStudent getAbridgedStudent();
    public String[] getAbridgedProjectHeader();
    public String getAbridgedNewProjects();
    public GWTProject getProject(String projectId) throws Exception;
}
